package net.roobook.server.system.controller;

import net.roobook.common.web.BaseController;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.security.Principal;

/**
 * @Author Roobook
 * @description 测试资源服务器，对外提供一些REST服务
 * @date 2022/4/8
 */
@RestController
public class HelloController extends BaseController {
    @GetMapping("info")
    public String test(){
        return "server-system";
    }

    @GetMapping("currentUser")
    public Principal currentUser(Principal principal) {
        return principal;
    }

    // 供server-test Feign远程调用演示
    @GetMapping("hello")
    public String hello(String name) {
        log.info("/hello服务被调用");
        return "hello " + name;
    }

}
